package com.gao.manager.jwt.impl;

import com.gao.manager.jwt.JwtKeeper;
import org.springframework.stereotype.Component;

import java.util.HashSet;
import java.util.Set;

/**
 * @author gao
 * @time 2022/11/10 21:19:08
 */
@Component
public class InMemoryJwtKeeper implements JwtKeeper {

    private Set<String> jwtSet = new HashSet<>();

    @Override
    public void add(String jwt) {
        jwtSet.add(jwt);
    }

    @Override
    public void remove(String jwt) {
        jwtSet.remove(jwt);
    }

    @Override
    public boolean contains(String jwt) {
        return jwtSet.contains(jwt);
    }
}
